/qemu/hw/ppc/ |
H A D | rs6000_mc.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | spapr_pci.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | spapr.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/hyperv/ |
H A D | vmbus.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/net/ |
H A D | filter-buffer.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | dump.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | colo-compare.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/backends/ |
H A D | hostmem-memfd.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | hostmem-file.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | cryptodev.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | hostmem.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/misc/ |
H A D | aspeed_sdmc.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/mem/ |
H A D | nvdimm.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | pc-dimm.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/xen/ |
H A D | xen_pt_config_init.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/block/ |
H A D | throttle-groups.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | replication.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
H A D | quorum.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/acpi/ |
H A D | core.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/ |
H A D | iothread.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/s390x/ |
H A D | ipl.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/qga/ |
H A D | commands-win32.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|
/qemu/hw/i386/ |
H A D | pc.c | dcfe4805 Tue Jul 07 16:06:01 GMT 2020 Markus Armbruster <armbru@redhat.com> error: Avoid unnecessary error_propagate() after error_setg()
Replace
error_setg(&err, ...); error_propagate(errp, err);
by
error_setg(errp, ...);
Related pattern:
if (...) { error_setg(&err, ...); goto out; } ... out: error_propagate(errp, err); return;
When all paths to label out are that way, replace by
if (...) { error_setg(errp, ...); return; }
and delete the label along with the error_propagate().
When we have at most one other path that actually needs to propagate, and maybe one at the end that where propagation is unnecessary, e.g.
foo(..., &err); if (err) { goto out; } ... bar(..., &err); out: error_propagate(errp, err); return;
move the error_propagate() to where it's needed, like
if (...) { foo(..., &err); error_propagate(errp, err); return; } ... bar(..., errp); return;
and transform the error_setg() as above.
In some places, the transformation results in obviously unnecessary error_propagate(). The next few commits will eliminate them.
Bonus: the elimination of gotos will make later patches in this series easier to review.
Candidates for conversion tracked down with this Coccinelle script:
@@ identifier err, errp; expression list args; @@ - error_setg(&err, args); + error_setg(errp, args); ... when != err error_propagate(errp, err);
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-34-armbru@redhat.com>
|